﻿using HomeCinema.Data.Infrastructure;
using HomeCinema.Data.Repositories;
using HomeCinema.Entities;
using HomeCinema.Web.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace HomeCinema.Web.Controllers
{
    [Authorize(Roles="Admin")]
    [RoutePrefix("api/movies")]
    public class MoviesController : ApiControllerBase
    {
        private readonly IEntityBaseRepository<Movie> _moviesRepository;
        private readonly IEntityBaseRepository<Rental> _rentalsRepository;
        private readonly IEntityBaseRepository<Stock> _stocksRepository;
        private readonly IEntityBaseRepository<Customer> _customersRepository;
        public MoviesController(IEntityBaseRepository<Movie> moviesRepository,
                                IEntityBaseRepository<Rental> rentalsRepository,
                                IEntityBaseRepository<Stock> stocksRepository,
                                IEntityBaseRepository<Customer> customersRepository,
                                IEntityBaseRepository<Error> _errorsRepository, IUnitOfWork _unitOfWork): base(_errorsRepository, _unitOfWork)
                                {
                                    _moviesRepository = moviesRepository;
                                    _rentalsRepository = rentalsRepository;
                                    _stocksRepository = stocksRepository;
                                    _customersRepository = customersRepository;
                                }

    }
}
